#ifndef DEMO_H
#define DEMO_H

#include <QWidget>
#include <QPushButton>
#include <QPainter>
namespace Ui {
class Demo;
}

class Demo : public QWidget
{
    Q_OBJECT

public:
    explicit Demo(QWidget *parent = nullptr);
    void set_button(QPushButton *s,bool checked);
    void set_line(QPushButton *s1,QPushButton *s2);//灰色
    void set_line_blue(QPushButton *s1,QPushButton *s2);//红色
    void set_line_find(QPushButton *s1,QPushButton *s2);//黄色
    bool eventFilter(QObject *watched, QEvent *event);
    void init();
    void set_button_id();
    int get_button_id(QString s);
    void Floyd(QString sp,QString lp);
    void paint();
    QPushButton* querybutton_byid(int id );
    QString get_button_name(int id);
    void er_button();
    void f_timer();
    void grab_img();
    void grab_mask();
    void Dijkstra(QString sp,QString lp);
    bool has_selected(int arr[], int i, int num_arr);
    int search_min(double arr[], int S[], int num_arr);
    void set_line_red(QPushButton *s1,QPushButton *s2);
    bool has_line(int a,int b);
    void set_line_purple(QPushButton *s1,QPushButton *s2);
    ~Demo();

private slots:

    void on_luzhou_button_clicked();

    void on_algorithm_1_clicked();

    void on_luzhou_button_pressed();

    void on_luzhou_button_clicked(bool checked);

    void on_bazhong_button_clicked(bool checked);

    void on_dazhou_button_clicked(bool checked);

    void on_deyang_button_clicked(bool checked);

    void on_guangan_button_clicked(bool checked);

    void on_guangyuan_button_clicked(bool checked);

    void on_kangding_button_clicked(bool checked);

    void on_leshan_button_clicked(bool checked);

    void on_maerkang_button_clicked(bool checked);

    void on_meishan_button_clicked(bool checked);

    void on_mianyang_button_clicked(bool checked);

    void on_nanchong_button_clicked(bool checked);

    void on_neijiang_button_clicked(bool checked);

    void on_panzhihua_button_clicked(bool checked);

    void on_suining_button_clicked(bool checked);

    void on_xichang_button_clicked(bool checked);

    void on_yaan_button_clicked(bool checked);

    void on_yibin_button_clicked(bool checked);

    void on_zigong_button_clicked(bool checked);

    void on_chengdu_button_clicked(bool checked);

    void on_ziyang_button_clicked(bool checked);

    void on_test_clicked();

    void on_chengdu_button_clicked();

    void on_clean_clicked();

    void on_test_2_clicked();

    void on_algorithm_2_clicked();

    void on_pushButton_clicked();

private:
    Ui::Demo *ui;
    QPainter *painter;
};

#endif // DEMO_H
